#include <avr/io.h>
#include <inttypes.h>
#include <util/delay.h>
#include <inttypes.h>
#include <avr/pgmspace.h>
#include <avr/interrupt.h>
#include <avr/sleep.h>

#include "lcd.h"
#include "i2c.h"


int main(void){
   
    unsigned char r1,r2,r3;
	PORTC = 0x03;
	lcd_init(LCD_DISP_ON_CURSOR_BLINK);
    lcd_clrscr();
	
	
	I2C_setbitrate(400);
	I2C_write(0b01010000,0x01,0x01);
	_delay_ms(150);
	I2C_write(0b01010000,0x02,0x02);
	_delay_ms(150);
	I2C_write(0b01010000,0x03,0x04);
	_delay_ms(150);
	
	
	r1=I2C_read(0b01010000,0x01);
	_delay_ms(150);
	r2=I2C_read(0b01010000,0x02);
	_delay_ms(150);
	r3=I2C_read(0b01010000,0x03);
	_delay_ms(150);
	lcd_putc('0'+r1);
	lcd_putc('0'+r2);
	lcd_putc('0'+r3);
	
    while(1){
	lcd_puts("d");
    
		   _delay_ms(1000);
    }
    return 0;
}
